{
 "metadata": {
  "signature": "sha256:dc7ffc457800317b07d039c81245e6d75d7ab5425ffc57f875fe43d920c6e581"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Matplotlib: deleting an existing data series\n",
      "======================================================================\n",
      "\n",
      "Each axes instance contains a lines attribute, which is a list of the\n",
      "data series in the plot, added in chronological order. To delete a\n",
      "particular data series, one must simply delete the appropriate element\n",
      "of the lines list and redraw if necessary.\n",
      "\n",
      "The is illustrated in the following example from an interactive session:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      ">>> x = N.arange(10)\n",
      "\n",
      ">>> fig = P.figure()\n",
      ">>> ax = fig.add_subplot(111)\n",
      ">>> ax.plot(x)\n",
      "[<matplotlib.lines.Line2D instance at 0x427ce7ec>]\n",
      "\n",
      ">>> ax.plot(x+10)\n",
      "[<matplotlib.lines.Line2D instance at 0x427ce88c>]\n",
      "\n",
      ">>> ax.plot(x+20)\n",
      "[<matplotlib.lines.Line2D instance at 0x427ce9ac>]\n",
      "\n",
      ">>> P.show()\n",
      ">>> ax.lines\n",
      "[<matplotlib.lines.Line2D instance at 0x427ce7ec>,\n",
      " <matplotlib.lines.Line2D instance at 0x427ce88c>,\n",
      " <matplotlib.lines.Line2D instance at 0x427ce9ac>]\n",
      "\n",
      ">>> del ax.lines[1]\n",
      ">>> P.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "which will plot three lines, and then delete the second.\n"
     ]
    }
   ],
   "metadata": {}
  }
 ]
}